package com.gridmobi.xrtb.component.lucene;

import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.gridmobi.xrtb.model.rtb.TrdImprDto;

import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.LongAdder;

/**
 * 简单的rtb相关数据 可以不用lucene 存储
 */
public class SimpleBidData {
    /**
     * micro bid map
     */
    public static ConcurrentHashMap<String, Float> MICRO_BID = new ConcurrentHashMap();
    public static ConcurrentHashMap<String, LongAdder> COUNTRY_REQUEST = new ConcurrentHashMap();
    public static ConcurrentHashMap<String, LongAdder> APP_REQUEST = new ConcurrentHashMap();
    public static Set<String> GEO_OS_APP = Sets.newConcurrentHashSet();
    public static Map<String,  Set<String>> GEO_OS_APPS = Maps.newConcurrentMap();

    /**
     * global
     */
    public static Set<String> BLOCK_LIST = Sets.newConcurrentHashSet();


    public static void main(String[] args) {
        MICRO_BID.put("aa^aaa", 1f);
        System.out.println("aa^aaa" + MICRO_BID.get(" aaa"));
        BLOCK_LIST.add("aa^aaa");
        System.out.println(BLOCK_LIST.size());
        BLOCK_LIST.remove("aa^aaa");
        System.out.println(BLOCK_LIST.size());


    }



    public static ConcurrentHashMap<String, String> CAMPAIGN_APPSTOREURL = new ConcurrentHashMap();
    public static Map<String, TrdImprDto> LAND_URL_TRD = Maps.newHashMap();
    public static Map<String, Integer> CAMPAIGN_IMPR_CNT = Maps.newHashMap();
    public static ConcurrentHashMap<String, String> CAMPAIGN_APPBUNDLE = new ConcurrentHashMap();

}
